package com.cloud.code.真题;

import java.util.Scanner;

public class Demo16 {


    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);


        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            int tar = scanner.nextInt();
            int sum = 0;
            int[] xnums = new int[n];
            int[] offsety = new int[n];

            for (int i = 0; i < n; i++) {
                xnums[i] = scanner.nextInt();
                offsety[i] = scanner.nextInt();
            }
            int y = offsety[0];
            for (int i = 1; i < n; i++) {
                int x = xnums[i] - xnums[i-1];
                sum = sum+x*Math.abs(y);
                y = y + offsety[i];
            }

            if(xnums[n-1] != tar){
                sum = sum + (tar-xnums[n-1])*Math.abs(y);
            }

            System.out.println(sum);
        }
    }
}
